#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int removeDuplicates(int* nums, int numsSize) 
{
    int k = 1; int* s1 = nums; int* s2 = nums; 
    while (s2!=nums+numsSize)
    {
        if (*s2 != *s1) //1 2 3 4 5 `
        {
            s1++;
            *s1 = *s2;
            s2++;
            k++;
        }
        else
        {
            s2++;
        }
    }
    return k;
}
int main()
{
    int arr[10] = { 0 };
    int n = 0; int i = 0;
	scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
    }
    int k = removeDuplicates(arr, n);
    for (i = 0; i < k; i++)
    {
        printf("%d ", arr[i]);
    }

}